package com.pan.admin.generator.constant;

import com.gitee.apanlh.util.base.Eq;

/**
 *  API生成器枚举
 *
 *  @author pan
 */
public enum ApiGenEnum {

    /** 下游_机构对接 */
    API_ORG("apiOrg",                       "com.ts.api.http.org"),
    /** 下游_全流程 */
    API_PLAT_V3("apiPlatV3",                "com.ts.api.http.platform"),
    /** 下游_V2回调，进件拉取通知模式 */
    API_PLAT_V2_PULL("apiPlatV2Pull",       "com.ts.api.http.platform"),

    /** 上游-API渠道-V2回调，进件拉取通知模式 */
    API_CHANNEL_V2_PULL("apiChannelV2Pull", ""),
    /** 上游-API渠道-V3全流程 */
    API_CHANNEL_V3("apiChannelV3",          ""),

    /** 上游-联登 */
    CHANNEL_FEDERATE("channelFederate",     "")
    /** API渠道 */

    ;
    private final String typeName;

    private final String packageName;

    ApiGenEnum(String typeName, String packageName) {
        this.typeName = typeName;
        this.packageName = packageName;
    }

    public String getTypeName() {
        return typeName;
    }

    public String getPackageName() {
        return packageName;
    }

    public static ApiGenEnum getEnum(String typeName) {
        ApiGenEnum[] values = ApiGenEnum.values();
        for (int i = 0; i < values.length; i++) {
            if (Eq.str(values[i].getTypeName(), typeName)) {
                return values[i];
            }
        }
        return null;
    }
}
